
CROSS_COMPILE = /home/lhy/arm_linux/tool/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
CC = ${CROSS_COMPILE}gcc
LD = ${CROSS_COMPILE}ld
OBJCOPY = ${CROSS_COMPILE}objcopy
OBJDUMP = ${CROSS_COMPILE}objdump

NAME	:= ledc
OBJS 	:= start.o main.o

${NAME}.bin:$(OBJS)
	${LD} -Timx6ul.lds -o ${NAME}.elf $^
	${OBJCOPY} -O binary -S ${NAME}.elf $@
	${OBJDUMP} -D -m arm ${NAME}.elf > ${NAME}.dis
	
%.o:%.s
	${CC} -Wall -nostdlib -c -O2 -o $@ $<
	
%.o:%.S
	${CC} -Wall -nostdlib -c -O2 -o $@ $<
	
%.o:%.c
	${CC} -Wall -nostdlib -c -O2 -o $@ $<
	
clean:
	rm -rf *.o ${NAME}.bin ${NAME}.elf ${NAME}.dis load.imx
	
